package org.kumas.sgrpc.common.threadpool.manager;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.ScheduledExecutorService;

import org.kumas.sgrpc.common.URL;
import org.kumas.sgrpc.common.extension.SPI;

@SPI("DefaultExecutorRepository")
public interface ExecutorRepository {


    ExecutorService createExecutorIfAbsent(URL url);

    ExecutorService getExecutor(URL url);

    void updateThreadpool(URL url, ExecutorService executor);

    ScheduledExecutorService nextScheduledExecutor();

    ScheduledExecutorService getServiceExporterExecutor();

    ExecutorService getSharedExecutor();

    void destroyAll();
}